//
//  StaffBaseYellowTitleView.m
//  AppHelpStaff
//
//  Created by Zheng on 2018/7/10.
//  Copyright © 2018年 app.help.staff.zhengcx. All rights reserved.
//

#import "StaffBaseYellowTitleView.h"

@implementation StaffBaseYellowTitleView

- (instancetype)initWithTitle:(NSString *)title {
    self = [super init];
    if (self) {
        _title = title;
        [self createSubviews];
    }
    return self;
}

#pragma mark - Subviews
#pragma amrk layout subviews
- (void)layoutSubviewsInView {
    
    [_yellowLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.left.right.equalTo(self);
        make.height.mas_equalTo(kScale(5));
    }];

    [_titleLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self);
    }];
    
}

#pragma mark create subviews
- (void)createSubviews {
    
    [self addSubview:self.yellowLineView];
    [self addSubview:self.titleLbl];

    [self layoutSubviewsInView];
}

- (UILabel *)titleLbl {
    if (!_titleLbl) {
        _titleLbl = [[UILabel alloc] init];
        _titleLbl.textColor = kFontBlueColor;
        _titleLbl.font = kBoldFont(15);
        _titleLbl.textAlignment = NSTextAlignmentCenter;
        _titleLbl.text = _title;
    }
    return _titleLbl;
}

- (UIView *)yellowLineView {
    if (!_yellowLineView) {
        _yellowLineView = [[UIView alloc] init];
        _yellowLineView.backgroundColor = kRGB(255, 255, 60, 1);
    }
    return _yellowLineView;
    return _yellowLineView;
}

@end
